

<?php
if ($this->code == "0"){
    echo "<legend>";
    echo $this->msg;
    echo "</legend>";
}else echo $this->msg;

if ($this->code == ""){
?>

<legend>Reward</legend>
<div class="row clearfix">
<div class="col-md-12 column">


                <?php //echo $this->today;?>


                        <table class="table" width="100px">
                                        <thead>
                                                <tr>
                                                        <th>
                                                                Reward
                                                        </th>
                                                        <th>
                                                                Status Reward
                                                        </th>
                                                        <th>
                                                                Keterangan Reward
                                                        </th>
                                                       
                                                </tr>
                                        </thead>
                                        <tbody>
                                            
                                                <tr class="active">
                                                        <td>
                                                                <?php echo $this->rewardList['class_reward'];?>
                                                        </td>
                                                        <td>
                                                                <?php echo $this->rewardList['class_reward_stat'];?>
                                                        </td>
                                                        <td>
                                                                <?php echo $this->rewardList['class_reward_note'];?>
                                                        </td>
                                                        
                                                </tr>
                                              
                                        </tbody>
                                </table>
  

                <br>
</div>
</div>
        <script>

        function pilihRek(obj){
            
            if (obj.value == "1"){
                $("#toAcc").removeAttr('disabled');

                $("#toOtherAcc").val('');
                $("#toOtherAcc").attr('disabled','disabled');


                $("#cbSave").removeAttr('checked');
                $("#cbSave").attr('disabled','disabled');

                $("#saveAs").val('');
                $("#saveAs").attr('disabled','disabled');
            }else{

                $("#toAcc").attr('disabled','disabled');

                $("#toOtherAcc").removeAttr('disabled');
                $("#cbSave").removeAttr('disabled');
                $("#saveAs").removeAttr('disabled');
            }
        }

        function validateNumber(evt) {

            var charCode = (evt.which) ? evt.which : event.keyCode
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
          }

        /* Attach a submit handler to the form */
        $("#frm").submit(function(event) {

            /* Stop form from submitting normally */
            event.preventDefault();

            /* Clear result div*/
            $("#div_result").html('');
            $("#btnSubmit").html('Memproses...');
            $("#btnSubmit").attr('disabled','disabled');

            /* Get some values from elements on the page: */
            var values = $(this).serialize();

            var msg = [];

            /* Send the data using post and put the results in a div */
            
            $.ajax({
                url: "point/",
                type: "post",
                data: values,
                success: function(response, opts){

                    var cekSess = response.toUpperCase().search("SESSION TIMEOUT");

                    if (cekSess < 0){

                        var cekStatus = response.toUpperCase().search("ERROR");

                        if (cekStatus < 0){
                            $("#div_content").html(response);
                        }else{
                            var resp = response.replace('ERROR', '');

                            msg.push('<span>'+resp+'</span>');
                            $.messager.alert('Info', msg.join('<br/>'));

                            //$("#div_result").html(resp);
                            $("#btnSubmit").removeAttr('disabled');
                            $("#btnSubmit").html('Submit');

                    
                        }
                    }else{
                        location.href='<?php echo $this->baseUrl() ?>/index/login/msg/Session Timeout silahkan login kembali !';
                    }
                },
                error:function(response, opts){
                    //alert("failure");
                    $("#div_result").html(response);
                    $("#btnSubmit").removeAttr('disabled');
                }
            });
            

        });

        </script>

        <?php } ?>
    